package com.haoxuer.discover.storage.data.entity;

import com.haoxuer.discover.data.entity.AbstractEntity;
import com.haoxuer.discover.storage.data.enums.FileType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "storage_file")
public class FileEntity extends AbstractEntity {
  
  /**
   * 文件名称
   */
  private String name;
  
  /**
   * 文件路径
   */
  private String path;
  
  /**
   * 文件磁盘路径
   */
  private String diskPath;
  
  private Long volume;
  
  @ManyToOne(fetch = FetchType.LAZY)
  private FileEntity parent;
  
  @ManyToOne(fetch = FetchType.LAZY)
  private BucketEntity bucket;
  
  private FileType fileType;
  
  public String getName() {
    return name;
  }
  
  public void setName(String name) {
    this.name = name;
  }
  
  public String getPath() {
    return path;
  }
  
  public void setPath(String path) {
    this.path = path;
  }
  
  public String getDiskPath() {
    return diskPath;
  }
  
  public void setDiskPath(String diskPath) {
    this.diskPath = diskPath;
  }
  
  public Long getVolume() {
    return volume;
  }
  
  public void setVolume(Long volume) {
    this.volume = volume;
  }
  
  public FileType getFileType() {
    return fileType;
  }
  
  public void setFileType(FileType fileType) {
    this.fileType = fileType;
  }
  
  public FileEntity getParent() {
    return parent;
  }
  
  public void setParent(FileEntity parent) {
    this.parent = parent;
  }
  
  public BucketEntity getBucket() {
    return bucket;
  }
  
  public void setBucket(BucketEntity bucket) {
    this.bucket = bucket;
  }
}
